#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2025/6/20 16:46
# @Author  : Chenmm
# @File    : message_schema.py.py
# @Software: PyCharm


from pydantic import BaseModel, Field
from typing import List



class MessageContent(BaseModel):
    """留言"""
    accept_uid: int   # 接收留言用户id
    content: str = Field(min_length=5, max_length=500)


class Messages(BaseModel):
    id: int
    send_user: str
    accept_user: str
    read: bool
    send_time: str
    add_time: str
    context: str


class MessagePid(Messages):
    pid: int


class MessageOne(Messages):
    pid: List[MessagePid] = []


class RebackMessage(MessageContent):
    # 回复留言
    rebackid: int  # 消息id